
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using My.Resources;
using TeacherLeftHand.Properties;


public partial class SaveFileDialog 
{

    public string Res = "";

    public SaveFileDialog()
    {
        InitializeComponent();
    }
    public void SetFileInfo(string name, DocumentEditor documentEditor) 
    {
        Label1.Content = "Do you want to save " + name;
        //RichTextBox1.AppendText("");
    }

    #region Buttons

    public void YesButton_Click(System.Object sender, RoutedEventArgs e)
    {
        Res = "Yes";
        Close();
    }

    public void NoButton_Click(object sender, RoutedEventArgs e)
    {
        Res = "No";
        Close();
    }

    public void CancelButton_Click(object sender, RoutedEventArgs e)
    {
        Res = "Cancel";
        Close();
    }

    #endregion

    public void SaveFileDialog_Closing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        if (this.WindowState == System.Windows.WindowState.Maximized)
        {
            Settings.Default.SaveDialog_IsMax = true;
        }
        else
        {
            Settings.Default.SaveDialog_IsMax = false;
        }
    }

    //public void SaveFileDialog_Loaded(object sender, RoutedEventArgs e)
    //{
    //    System.IO.FileStream fs = System.IO.File.OpenRead(My.MyWpfExtension.Computer.FileSystem.SpecialDirectories.Temp + "\\TVPre.xaml");
    //    TextRange tr = new TextRange(RichTextBox1.Document.ContentStart, RichTextBox1.Document.ContentEnd);
    //    FlowDocument content = System.Windows.Markup.XamlReader.Load(fs) as FlowDocument;
    //    RichTextBox1.Document = content;
    //    fs.Close();
    //    if (MS.WindowsAPICodePack.Internal.CoreHelpers.RunningOnWin7 || MS.WindowsAPICodePack.Internal.CoreHelpers.RunningOnVista)
    //    {
    //        AppHelper.ExtendGlassFrame(this, new Thickness(-1, -1, -1, -1));
    //    }
    //    if (MySettings.Default.SaveDialog_IsMax)
    //    {
    //        this.WindowState = System.Windows.WindowState.Maximized;
    //    }
    //    else
    //    {
    //        this.WindowState = System.Windows.WindowState.Normal;
    //    }
    //}
}

